<jsp:include page="/include/header.jsp" />
<%@page import="business.*" %>

<%
       User user = (User) request.getAttribute("user");
       String message = (String) request.getAttribute("message");
       if (user == null) user = new User("", "", "");
       if (message == null) message = "";
%>
<h1>Join our email list</h1>
<p>To join our email list, enter your name and email address below<br>
    Then, click on Summit button</p>
<p><i><%= message %></i></p>
<form action="<%= response.encodeURL("AddEmailToDbServlet") %>" method="post">
    <table border="0" cellspacing="5">
        <tr>
            <td align="right">First Name:</td>
            <td><input type="text" name="firstName" 
                       value=<%= user.getFirstName() %>></td>
        </tr>
        <tr>
            <td align="right">Last Name:</td>
            <td><input type="text" name="lastName"
                       value =<%= user.getLastName() %>></td>
        </tr>
        <tr>
            <td align="right">Email Address:</td>
            <td><input type="text" name ="emailAddress"
                       value=<%= user.getEmailAddress() %>></td>
        </tr><br>
        <tr>
            <td></td>
            <td><input type="submit" value="Submit"></td>
        </tr>
    </table>
</form>

<jsp:include page="/include/footer.jsp" />
